<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ include file="taglibs.jsp" %>


    

<div id="middleWrapper">
<div class="topCurveMiddle"></div>
<div class="clearBoth"></div>
<div class="ContentSection">


	<form:form action="createUser.html" id="innerForm" name="innerForm" commandName="user" method="post"  onsubmit="submitFun()">
           <div class="fieldbox">
              <label>UserName:<em>*</em></label>
              <form:input path="userName" onkeydown="return processKey(event)"/><FONT color="red">&nbsp;<form:errors path="userName" /></FONT>
            </div>
		
			<div class="fieldbox">
              <label>Password:<em>*</em></label>
              <form:input path="password" onkeydown="return processKey(event)"/><FONT color="red">&nbsp;<form:errors path="password" /></FONT>
            </div>	
            <div class="fieldbox">
              <label>Role:<em>*</em></label>
              <form:select path="role">
				<form:option value="ROLE_USER">user</form:option>
                <form:option value="ROLE_ADMIN">admin</form:option>
                <form:option value="ROLE_SUPER_ADMIN">superadmin</form:option>
                <form:option value="ROLE_MANAGER">manager</form:option>
                
               </form:select> <FONT color="red">&nbsp;<form:errors path="role" /></FONT>
            </div>	
			 <div class="clearBoth"></div>
            <div class="fieldbox">
            <input type="submit" value="cancel" name="cancel" class="buttonNew" /> 
            <input type="submit" value="save"  name="save" class="buttonNew buttonNew1" id="saveId" />
              
            </div>
				 <div class="clearBoth"></div>
			
	</form:form>
	</div>
	<div class="clearBoth"></div>
        <div class="bottomCurveMiddle"></div>
        <div class="clearBoth"></div>
	
</div>

<script type="text/javascript">
function submitFun(){
   // this function is for intercepting enter button action
   document.getElementById("saveId").click();
   return true;
}

//when we press enter it should go to submit button
function processKey(e)
{
    if (null == e)
        e = window.event ;
    if (e.keyCode == 13)  {
        document.getElementById("saveId").click();
        return false;
    }
}

</script>

